/**
 * 2015，thor.com，all rights reserved。
 * 
 * Project：		thor-common
 * Filename：	QueryResultConverter.java
 * Created：		2015年3月14日
 * Creator：		thor
 */
package com.thor.palmmall.rest.common;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.spi.common.SOperator;

/**
 * @author thor
 *
 */
public class SOperatorConverter_v2 implements Converter<AOperator, SOperator> {

  public static SOperatorConverter_v2 getInstance() {
    if (instance == null)
      instance = new SOperatorConverter_v2();
    return instance;
  }

  private static SOperatorConverter_v2 instance;

  private SOperatorConverter_v2() {
  }

  @Override
  public SOperator convert(AOperator source) {
    if (source == null)
      return null;

    SOperator target = new SOperator();
    target.setFullName(source.getFullName());
    target.setId(source.getId());
    target.setNamespace(source.getNamespace());
    return target;
  }
}
